package com.wondersgroup.fjzlpt.yyzyzx.controller.rest.yyzygl.jcgzgl;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.quick.framework.util.QuickPrincipalUtils;
import com.wondersgroup.fjzlpt.yyzyzx.service.inter.yyzygl.jcgzgl.XmhcgzszService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.utils.RequestUtils;

/**
 * 项目互斥规则设置
 * @author gzb   
 * 2017年8月8日
 */
@RestController
@RequestMapping("/xmhcgzsz")
public class XmhcgzszRestController {

	@Autowired
	private XmhcgzszService xmhcgzszService;
	
	/**
	 * 保存/修改 项目互斥规则设置
	 * @param request
	 * @return
	 */
	@RequestMapping("/save")
	public JSONObject save(HttpServletRequest request){
		Map map = RequestUtils.GetParameterMap(request);
		return xmhcgzszService.save(map);
	}
	
	/**
	 * 分页查询 项目互斥规则设置
	 * @param request
	 * @return
	 */
	@RequestMapping("/queryPage")
	public JSONObject queryPage(HttpServletRequest request){
		String xzqh = QuickPrincipalUtils.getXzqhdm(request);
		Map map = RequestUtils.GetParameterMap(request);
		map.put("XZQHDM",xzqh);
		return xmhcgzszService.queryPage(map);
	}
	
	/**
	 * 删除 项目互斥规则设置
	 * @param request
	 * @return
	 */
	@RequestMapping("/delete")
	public JSONObject delete(HttpServletRequest request){
		Map map = RequestUtils.GetParameterMap(request);
		return xmhcgzszService.delete(map);
	}
	
	/**
	 * 查询被排斥项目
	 * @param request
	 * @return
	 */
	@RequestMapping("queryBpcxm")
	public JSONObject queryBpcxm(HttpServletRequest request){
		Map map = RequestUtils.GetParameterMap(request);
		return xmhcgzszService.queryBpcxm(map);
	}
	
	
	
}
